﻿using UnityEngine;
using System.Collections;

public class camera : MonoBehaviour
{
    private float z=0;
    private float x;
    private float y;
    //水平速度
    public float Speed = 2.0F;
    //垂直速度
    private Vector3 one;
    void Update()
    {
        //水平方向

        float h = Speed * Input.GetAxis("Mouse X");
        //垂直方向
        float v = Speed * Input.GetAxis("Mouse Y");
        //旋转
        x = x + h;
        y = y + v;
        transform.eulerAngles =new Vector3 (-y,x,0 );
        
    }
}
